Setting method and setting apparatus for operation path for articulated robot

ABSTRACT

A temporary operation path is set by connecting a plurality of welding points in a virtual space generated by a computer to investigate whether an end effector can be operated along the temporary operation path. If the operation cannot be operated, a path to avoid interference with a workpiece is set automatically while extracting a portion in which the workpiece exists in the internal space surrounded by the end effector in order to set a narrow-area operation path for withdrawing the end effector from a welding point. Next, in order to set a wide-area operation path for making movement between withdrawing points, a template operation is applied, in which the end effector is moved by a prescribed distance in a prescribed direction.

This application is the national phase under 35 U.S.C. § 371 of PCTInternational Application No. PCT/JP01/10202 which has an Internationalfiling date of Nov. 22, 2001, which designated the United States ofAmerica.

1. Technical Field

The present invention relates to a setting method and a settingapparatus for an operation path for an articulated robot. Specifically,the present invention relates to a setting method and a settingapparatus for an operation path for an articulated robot, for settingthe path for operating an end effector provided at a forward end of thearticulated robot, between predetermined operation points.

2. Background Art

Conventionally, if an articulated robot installed for a production lineis directly operated to perform the teaching of the operation posture,an operator skilled in the operation of the articulated robot shouldperform the operation at the working site of the production line.Accordingly, the operation becomes inefficient. The above operationshould also be performed with the production line being stopped.Therefore, the operation rate of the production line is decreased.

Recently, the teaching (off-line teaching) is performed based upon anoff-line procedure to efficiently perform the teaching operation or tomaintain the operation rate of the production line. In the off-lineteaching, a model, which includes an articulated robot, a workpiece asan operation objective, and peripheral structures, is constructed on acomputer. Teaching data is prepared by using the model, and then theteaching data is supplied to the articulated robot installed at theworking site. Therefore, it is unnecessary to stop the production lineduring the preparation of the teaching data.

The conventional off-line teaching is not necessarily used widely forthe following reason.

Naturally, the articulated robot should not interfere with (for example,contact) various peripheral structures, workpieces or the like. Whenvarious peripheral structures exist or when the workpiece is of acomplicated shape, it is difficult to set an operation path to avoidsuch obstacles.

More specifically, the round-robin method, in which the interference isinvestigated as to all postures of the articulated robot, is notpractical, because the amount of calculation is enormous. No solutionexists in some cases in the optimizing method such as the so-calledmathematical programming. Further, according to the stochastic techniqueusing random numbers, the convergence of solution is not assured and thecalculation has no reproducibility.

Several techniques have been suggested to solve the above problems.

For example, a technique is known, which utilizes a flat plane includinga start point and an arrival point (see Japanese Patent Publication No.2875498). In this technique, an off-limit area, in which a cross sectionof an obstacle is appropriately enlarged, is defined on a prescribedplane. An operation path, which passes through the apex of the off-limitarea, is set to avoid the interference. However, in this technique, theoperation path is set by verifying the interference with the off-limitarea at every time. For this reason, the verifying operation is complex,and the operation path is complicated. Even if the operation path isproper, it is also impossible to verify whether the articulated robotcan actually operate on the operation path from a viewpoint of operationranges of respective axes.

Another technique is also known, for example, in which the position andthe shape of an obstacle are inputted and instructed with an exclusivelyused controller in a production site to set an operation path (seeJapanese Laid-Open Patent Publication No. 9-81228). However, in thistechnique, the operation path cannot be set automatically, because theteaching is performed while operating the actual machine at theproduction site.

Accordingly, the above off-line teaching relies on the manual operationto set the operation path for avoiding the obstacles at present.

However, the manual operation needs a long period of time to extract anon-interference area in which the robot does not interfere with theworkpiece and other equipments. The judgment also differs depending onindividual persons. It is inevitable to cause any oversight and/or anyomission for the extraction point.

As described above, when the posture of the robot is determined by meansof the off-line teaching, the operation required therefor is notnecessarily easy. Especially, it is difficult to retrieve a path forretracting a gun unit from a welding point so that it may not interferewith a workpiece, on a monitor screen, when the workpiece is of acomplicated three-dimensional shape. It takes a long period of time toperform the teaching.

DISCLOSURE OF INVENTION

In consideration of the above problems, it is an object of the presentinvention to provide a setting method and a setting apparatus for anoperation path for an articulated robot, in which steps for determiningthe path are automatically performed, and teaching data can be preparedin a short period of time without requiring any skill, when off-lineteaching is performed for a withdrawing path to make no interferencewith a workpiece, in a narrow-area operation path for withdrawing an endeffector from an operation point on the workpiece, of operation pathsfor an articulated robot.

Another object of the present invention is to provide a setting methodand a setting apparatus for an operation path for an articulated robot,in which a wide-area operation path for making movement betweenoperation points or between withdrawing positions can be setautomatically and efficiently without performing any complicatedcalculation which may be affected by the shape of a workpiece and/or anobstacle.

Still another object of the present invention is to provide a settingmethod and a setting apparatus for an operation path for an articulatedrobot, in which a narrow-area operation path and a wide-area operationpath can be set automatically and efficiently.

According to the present invention, there is provided a method forsetting an operation path for an articulated robot including an endeffector, the method comprising an internal space-defining step ofdefining an internal space which is partially surrounded by an arm orelectrodes of the end effector; an extracting step of extracting anobjective workpiece portion which exists in the internal space, of aworkpiece to be welded; and an interference-investigating step ofinvestigating whether interference occurs between the end effector andthe objective workpiece portion when the articulated robot is operated.

Accordingly, the steps for determining the path are automaticallyperformed, and teaching data can be prepared in a short period of timewithout requiring any skill, when off-line teaching is performed for awithdrawing path to make no interference with a workpiece, in anarrow-area operation path for withdrawing an end effector from anoperation point on the workpiece.

In this case, the articulated robot, the end effector, the workpiece,and peripheral structures are virtual ones constructed as a model inaccordance with a program processing effected by a computer.

The workpiece may be a model which is approximated with a plurality ofblocks.

The internal space may be a model which is approximated with a pluralityof blocks.

Further, the interference-investigating step may comprise a referenceline-defining step of defining a reference line passing through asubstantially central portion of the objective workpiece portion; aninvestigation end position-defining step of setting an investigation endposition for the end effector on the reference line; and a firstdetailed interference-investigating step of investigating whetherinterference occurs between the end effector and the objective workpieceportion by operating the end effector from an investigation startposition to the investigation end position.

The interference-investigating step may comprise a referenceline-defining step of defining a reference line passing through asubstantially central portion of the objective workpiece portion; acenter of gravity position-defining step of defining a center of gravityposition of the objective workpiece portion based upon the referenceline; and a second detailed interference-investigating step ofinvestigating whether interference occurs between the end effector andthe objective workpiece portion by operating the end effector from aninvestigation start position to the center of gravity position.

A portion of the objective workpiece portion, which is located closelyto an opening as compared with the center of gravity position of theobjective workpiece portion, may be extracted as a new objectiveworkpiece portion with which the objective workpiece portion is replacedto perform the center of gravity position-defining step and the seconddetailed interference-investigating step.

According to another aspect of the present invention, there is providedan apparatus for setting an operation path for an articulated robotprovided with an end effector, the apparatus comprising an internalspace-defining section for defining an internal space which is partiallysurrounded by an arm or electrodes of the end effector; aworkpiece-extracting section for extracting an objective workpieceportion which exists in the internal space, of a workpiece to be welded;and an interference-investigating section for investigating whetherinterference occurs between the end effector and the objective workpieceportion when the end effector is operated.

According to still another aspect of the present invention, there isprovided a method for setting an operation path for an articulated robotfor operating an end effector from a start point to an arrival point,the method comprising an operation-investigating step of setting a pathfor connecting the start point and the arrival point to investigatewhether the end effector can be operated along the path; and aretracting path-setting step of setting a retracting path for operatingthe end effector by a prescribed distance in a prescribed direction fromthe start point or the arrival point if the end effector cannot beoperated along the path in the operation-investigating step.

Accordingly, a wide-area operation path for making movement betweenoperation points or between withdrawing positions can be setautomatically and efficiently without performing any complicatedcalculation which may be affected by the shape of a workpiece or anobstacle.

The prescribed direction may be a predetermined direction based on aposture of the end effector at the start point or the arrival point.

The prescribed direction may be a direction to connect the start pointor the arrival point and an established point in space.

The established point may be a central point of an original axis of thearticulated robot.

An end point of the retracting path may be defined as a new start pointor a new arrival point to execute the operation-investigating step orthe retracting path-setting step again.

The retracting path, in which the prescribed distance is corrected, maybe set again if an end point of the retracting path is a point at whichthe articulated robot cannot arrive or a point at which interferenceoccurs.

According to still another aspect of the present invention, there isprovided an apparatus for setting an operation path for an articulatedrobot for operating an end effector from a start point to an arrivalpoint, the apparatus comprising a path-investigating section for settinga path for connecting the start point and the arrival point toinvestigate whether the end effector can be operated along the path; anda wide-area operation path-setting section for setting a retracting pathfor operating the end effector by a prescribed distance in a prescribeddirection from the start point or the arrival point if thepath-investigating section judges that the end effector cannot beoperated along the path.

According to still another aspect of the present invention, there isprovided a method for setting an operation path for an articulated robotfor operating an end effector between operation points for a workpiece,the method comprising a narrow-area operation path-setting step ofsetting a narrow-area operation path along which the end effectorarranged at the operation point for the workpiece is retracted from theoperation point to a point located near an end of the workpiece whilemaintaining a non-interference state with respect to the workpiece andanother obstacle, based upon shapes of the obstacle and the workpiecenear the operation point; and a wide-area operation path-setting step ofsetting a wide-area operation path for effecting operation from a startpoint to an arrival point by combining predetermined prescribedoperations provided that the start point and the arrival point reside inpredetermined points of points located near the end.

Accordingly, it is possible to set the narrow-area operation path andthe wide-area operation path automatically and efficiently.

The narrow-area operation path-setting step may comprise an internalspace-defining step of defining an internal space which is partiallysurrounded by an arm or electrodes of the end effector; an extractingstep of extracting an objective workpiece portion which exists in theinternal space, of the workpiece; and an interference-investigating stepof investigating whether interference occurs between the end effectorand the objective workpiece portion when the articulated robot isoperated.

The wide-area operation path-setting step may comprise anoperation-investigating step of setting a path for connecting the startpoint and the arrival point to investigate whether the end effector canbe operated along the path; and a retracting path-setting step ofsetting a retracting path for operating the end effector by a prescribeddistance in a prescribed direction from the start point or the arrivalpoint if the end effector cannot be operated along the path in theoperation-investigating step.

The prescribed direction may be a predetermined direction based on aposture of the end effector at the start point or the arrival point.

The prescribed direction may be a direction to connect the start pointor the arrival point and an established point in space.

According to still another aspect of the present invention, there isprovided an apparatus for setting an operation path for an articulatedrobot for operating an end effector between operation points for aworkpiece, the apparatus comprising a narrow-area operation path-settingsection for setting a narrow-area operation path along which the endeffector arranged at the operation point for the workpiece is retractedfrom the operation point to a point located near an end of the workpiecewhile maintaining a non-interference state with respect to the workpieceand another obstacle, based upon shapes of the obstacle and theworkpiece near the operation point; and a wide-area operationpath-setting section for setting a wide-area operation path foreffecting operation from a start point to an arrival point by combiningpredetermined prescribed operations provided that the start point andthe arrival point reside in predetermined points of points located nearthe end.

The above and other objects, features, and advantages of the presentinvention will become more apparent from the following description whentaken in conjunction with the accompanying drawings in which a preferredembodiment of the present invention is shown by way of illustrativeexample.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 illustrates an off-line teaching apparatus and a robot apparatusto be used in an embodiment of the present invention;

FIG. 2 shows a block diagram illustrating an arrangement of the off-lineteaching apparatus;

FIG. 3 illustrates an arrangement of an articulated robot;

FIG. 4 illustrates an X-type welding gun;

FIG. 5 illustrates welding points for a workpiece;

FIG. 6 shows a flow chart illustrating an entire operation path-settingmethod for the articulated robot according to the embodiment of thepresent invention;

FIG. 7 shows a flow chart (No. 1) illustrating a narrow-area operationpath-setting method for the articulated robot according to theembodiment of the present invention;

FIG. 8 shows a flow chart (No. 2) illustrating the narrow-area operationpath-setting method for the articulated robot according to theembodiment of the present invention;

FIG. 9 shows a flow chart (No. 3) illustrating the narrow-area operationpath-setting method for the articulated robot according to theembodiment of the present invention;

FIG. 10 shows a path table;

FIG. 11A illustrates a procedure for setting lines radially from thecentral point;

FIG. 11B illustrates a procedure for extracting points of intersectionin a closed space by drawing lines in a lattice-shaped configuration;

FIG. 12A illustrates a procedure for setting solids about centers ofpoints of intersection;

FIG. 12B illustrates a procedure for extracting overlapped portions ofthe solids and the workpiece;

FIG. 12C shows an extracted workpiece model;

FIG. 13A illustrates central points of the respective solids;

FIG. 13B shows a procedure for determining a principal component line;

FIG. 14 shows a procedure for determining a withdrawing point and awithdrawing path (V1);

FIG. 15 shows a withdrawing path (V2);

FIG. 16 illustrates a mask process;

FIG. 17 illustrates an operation path from a start point to an arrivalpoint;

FIG. 18 shows a flow chart (No. 1) illustrating a wide-area operationpath-setting method for the articulated robot according to theembodiment of the present invention;

FIG. 19 shows a flow chart (No. 2) illustrating the wide-area operationpath-setting method for the articulated robot according to theembodiment of the present invention;

FIG. 20 shows a flow chart (No. 3) illustrating the wide-area operationpath-setting method for the articulated robot according to theembodiment of the present invention; and

FIG. 21 illustrates the operation of first and second templates.

BEST MODE FOR CARRYING OUT THE INVENTION

Illustrative embodiments of the setting method and the setting apparatusfor the operation path for the articulated robot according to thepresent invention will be explained below with reference to FIGS. 1 to21.

Basically, in the setting method and the setting apparatus for theoperation path for the articulated robot according to the embodiment ofthe present invention, the operation path is set while extracting theportion in which the workpiece exists to investigate the interference inthe internal space surrounded by the gun unit during the narrow-areaoperation in which the end effector provided at the forward end of thearticulated robot is withdrawn from the operation point on theworkpiece. During the wide-area operation for making movement betweenthe withdrawing positions, the operation path is set to move to thearrival point while avoiding the obstacle by operating while combiningthe template operations for making movement from the start point by theprescribed distance in the prescribed direction.

As shown in FIG. 1, an off-line teaching apparatus (operationpath-setting apparatus) 10, which is used in the embodiment of thepresent invention, performs teaching of the operation of an articulatedrobot 50. The apparatus 10 is linked to a robot apparatus 12 forperforming desired operation for an operation objective based uponprepared teaching data.

The robot apparatus 12 comprises the articulated robot 50, and a robotcontrol unit 22 for controlling the operation of the articulated robot50 based upon the teaching data.

As shown in FIG. 2, a control unit 14, which constitutes the off-lineteaching apparatus 10, includes CPU (computer) 26 as a control means forcontrolling the entire off-line teaching apparatus 10, ROM 28 and RAM 29as storage sections, a hard disk drive (HDD) 39 for effecting access ofdata with respect to the hard disk 34, a drawing control circuit 30 foreffecting drawing control on a screen of a monitor 16, an interfacecircuit 32 to which a keyboard 18 and a mouse 20 as input apparatusesare connected, a recording medium drive 36 for controlling an externalrecording medium 36 a (for example, a flexible disk or a compact disk),a data-preparing circuit 38 for preparing teaching data, and asimulation circuit 40 for effecting simulation on the screen of themonitor 16 based upon the teaching data. The simulation circuit 40 isbased on three-dimensional CAD, and it has, for example, the function toprepare the model and investigate the mutual interference of the model(interference-investigating section 40 a).

The hard disk 34 stores, for example, an operation path-setting program35 having the function to set the operation path for an articulatedrobot 50, condition data 37 as the condition for setting the operationpath, and unillustrated OS.

The operation path-setting program 35 includes a narrow-area operationpath-setting section 35 a for setting, for example, based upon the shapeof a workpiece 80, the narrow-area operation path along which a gun unit(end effector) 68, which is arranged on a point on the workpiece 80 (seeFIG. 5), for example, on a welding point T0, is retracted to a pointlocated near the end of the workpiece 80 while maintaining thenon-interference state with the workpiece 80 and other components, and awide-area operation path-setting section 35 b for setting the wide-areaoperation path along which the operation is effected from a start pointP1 to an arrival point P2 by combining predetermined prescribedoperations provided that the start point P1 (see FIG. 17) and thearrival point P2 reside in arbitrary two points in the space.

The operation path-setting program 35 has a path-investigating section35 c for investigating wither or not the gun unit 68 can be operated onthe path obtained by connecting two arbitrary points.

The operation path-setting program 35 further includes an internalspace-defining section 35 d for defining a predetermined internal spacein the virtual space, and a workpiece-extracting section 35 e forextracting a portion of the workpiece 80 to be welded existing in apredetermined space.

As shown in FIG. 3, a second base 56, a first link 58, a second link 60,a third link 62, a fourth link 64, and a gun attachment section 66 areconnected to a first base 54 as an attachment stand of the articulatedrobot 50 in this order toward the forward end. The gun unit 68 isconnected to the gun attachment section 66 disposed at the forward end.

The second base 56 is rotatable supported with respect to the first base54 about the center of the axis J1 as the vertical axis. The proximalend of the first link 58 is supported tiltably with respect to thesecond base 56 with the axis J2 as the horizontal axis. The proximal endof the second link 60 is supported swingably with respect to the forwardend of the first link 58 with the axis J3 as the horizontal axis. Thethird link 62 is connected on the forward end side of the second link 60with the axis J4 as the common central axis for rotation. Further, theproximal end of the fourth link 64 is supported swingably with respectto the forward end of the second link 62 with the axis J5 located in theright-angled direction with respect to the axis J4. The gun attachmentsection 66 is connected on the forward end side of the fourth link 64with the axis J6 as the common central axis for rotation.

The gun unit 68, which is connected to the gun attachment section 66, isa so-called C-type welding gun, and it has, at both ends of anarch-shaped arm 74, a pair of electrodes 70, 72 which areopenable/closable along the axis J6. In the closed state, the electrodes70, 72 make contact with the workpiece 80 at the welding operation point(hereinafter referred to as “TCP (Tool Center Point)”) for the axis J6.

The direction, which is directed from TCP and which is coincident withthe axial center of the electrode 72 of the main body, is designated as“vector Zr”. The direction, which is perpendicular to the vector Zr andwhich is directed outside of the gun unit 68, is designated as “vectorXr”. The direction, which is mutually perpendicular to the vector Xr andthe vector Zr, is designated as “vector Yr”.

The driving mechanism for the axes J1 to J6 and the opening/closingmechanism for the electrodes 70, 72 are driven by unillustratedactuators respectively. TCP is determined by the values of respectiveangles of rotation θ1 to θ6 of the axes J1 to J6 and the sizes of therespective sections of the articulated robot 50.

The gun unit 68 is not limited to the C-type welding gun. For example,an X-type welding gun shown in FIG. 4 (welding gun provided with a pairof opening/closing gun arms rotatably supported by a common supportshaft) 68 a may be used for the gun unit 68.

The point of intersection between the axis J1 and the axis J2 is definedas the origin (central point of the original axis) O as the referencepoint for the coordinate calculation and the control in relation to thearticulated robot 50. With the reference of the origin O, the verticallyupward direction is represented by the height Z, the direction of theaxis J2 obtained when the angle of rotation θ1 satisfies θ1=0 isrepresented by the depth Y, and the direction perpendicular to theheight Z and the depth Y is represented by the width X. Thethree-dimensional orthogonal coordinate is expressed with the height Z,the width X, and the depth Y.

Next, explanation will be made with reference to FIGS. 5 and 6 for theprocedure for setting the operation path for the articulated robot 50 byusing the off-line teaching apparatus 10 and the operation path-settingprogram 35 constructed as described above.

In the following description, an example will be explained as shown inFIG. 5 in which the gun unit 68 is successively moved between aplurality of welding points (operation points) Tn (n=0, 1, 2, . . . )for performing the welding for the workpiece 80 which is a thin plate.

The welding point Tn is represented by six values in total includingthree-dimensional orthogonal coordinate values (X, Y, Z) in the space inwhich the welding is performed and three parameters of TCP forindicating the posture of the gun unit 68.

Further, it has been already verified that the gun unit 68 of thearticulated robot 50 is capable of arriving at the welding point Tn, andthe posture of the gun unit 68 when the welding point Tn is welded,i.e., the values of the vector Xr, the vector Yr, and the vector Zr aredetermined as well.

According to the embodiment of the present invention, further, thearticulated robot 50, the workpiece 80, and the peripheral structuresare dealt with as virtual models in the off-line teaching apparatus 10.However, in the following description, these components will berepresented-by the same reference numerals as those of the actualapparatus.

The workpiece 80 is dealt with as the model composed of a plurality ofblocks in order to obtain a high speed of the processing.

In step S1 shown in FIG. 6, an operator for the off-line teachingapparatus 10 starts up the operation path-setting program 35 by apredetermined operation method. OS, which is incorporated in theoff-line teaching apparatus 10, loads the operation path-setting program35 stored on the hard disk 34 onto RAM 29 to execute the operationpath-setting program 35. The processing of the next step S2 and thefollowings are executed by the operation path-setting program 35.

Subsequently, in step S2, a temporary operation path 90 (see FIG. 5),which is obtained by connecting the welding points Tn, is set. Theoperation path 90 may be linear as shown in FIG. 5, or it may be anarbitrary curve along which the articulated robot 50 is operated withease. Operation paths 100, 102, 104, 110, 112 described later on may beset in the same manner as described above.

Subsequently, in step S3, it is investigated whether the articulatedrobot 50 is capable of setting the posture when the gun unit 68 isoperated along the temporary operation path 90. Further, it isinvestigated whether the gun unit 68 interferes with other structures orcomponents in the operation path 90.

Specifically, dividing points, which are obtained by dividing theoperation path 90 into those having minute lengths, are set. Thepostures of the articulated robot 50, i.e., the angles of rotation θ1 toθ6, which are provided when the gun unit 68 is arranged at therespective dividing points, are determined. As for the calculationmethod for the angles of rotation θ1 to θ6, a well-known matrixcalculation method (hereinafter referred to as “inverse operation”) maybe applied, for example, for the sizes of the respective sections of thearticulated robot 50 and the six values in total defined by the vectorXr, the vector Yr, and the vector Zr for representing the posture of thegun unit 68 and the spatial position coordinates (X, Y, Z) of thedividing points.

When the posture of the gun unit 68 differs between the welding pointsT0 and T1, the vector Xr, the vector Yr, and the vector Zr may bedefined at the respective dividing points in a manner of linearinterpolation. In this investigation, it is assumed that the electrodes70, 72 are opened so that they may not interfere with the workpiece 80.

If the posture of the articulated robot 50 holds at each of the dividingpoints, the operation from the welding point T0 to the welding point T1is actually assured.

Subsequently, in step S4, it is judged whether the solution of theinverse operation is normally determined at each of the dividing points.That is, it is judged whether TCP is capable of arriving at the dividingpoint. If the solution is not determined, if the value of the angle iswithout the rotatable range of the axis J1 to J6 even if the solution isdetermined, or if the articulated robot 50 interferes in the determinedposture (for example, interferes with the obstacle 82, other workpieces,and pillars in the factory), then the routine proceeds to step S5. Ifthe solution is normally determined, the solution is within therotatable range, and no interference occurs, then the routine proceedsto step S7.

The investigation for the interference is automatically performed by thefunction of the simulation circuit 40. When the simulation circuit 40 isused, it is possible to reliably perform the three-dimensionalinvestigation which is not clear from the screen of the monitor 16 asthe two-dimensional expression.

In step S5, the narrow-area operation path, which is used to withdrawthe gun unit 68 from the welding points T0 and T1, is set by thefunction of the narrow-area operation path-setting section 35 a. Adetailed method therefor will be described later on.

Subsequently, in step S6, the two withdrawing positions Ue (see FIG.14), which are obtained by the narrow-area operation path, are set asthe start point P1 and the arrival point P2 respectively to set thewide-area operation path for moving the gun unit 68 from the start pointP1 to the arrival point P2. The setting is performed by the function ofthe wide-area operation path-setting section 35 b. A detailed methodtherefor will be described later on.

After setting the narrow-area operation path and the wide-area operationpath, the routine proceeds to step S7.

In step S7, it is confirmed whether the investigation is performed forall of the operation paths 90 set in step S1 to complete the process. Ifthere is any operation path 90 which is not investigated, the routinereturns to step S3 to continue the investigation.

As described above, in the embodiment of the present invention, thewelding points Tn are firstly connected to one another by the operationpath 90. If the operation path 90 is not applied as it is, thenarrow-area operation path for avoiding, for example, any projection ofthe workpiece 80 and the obstacle 82 is set. Further, the wide-areaoperation path is set in order to make movement between the withdrawingpositions Ue obtained by setting the narrow-area operation path.

When the narrow-area operation path is set, the portion, in which theworkpiece exists, is extracted to investigate the interference in theinternal space which is partially surrounded by the gun unit 68.Therefore, it is possible to automatically set the path for avoiding anyinterference with the workpiece.

When the wide-area operation path is set, the template operation isapplied, in which the gun unit 68 is moved by a prescribed distance in aprescribed direction. Therefore, it is possible to automatically set thewide-area operation path without performing, any complicated calculationwhich may be affected by the shapes of the workpiece 80 and the obstacle82.

Further, the setting of the narrow-area operation path for withdrawingthe gun unit 68 of the articulated robot 50 from the welding point Tn onthe workpiece 80 and the setting of the wide-area operation path formaking movement from the start point P1 to the arrival point P2 areperformed by the different processes adapted to the respectiveprocesses. Therefore, it is possible to efficiently set the operationpath between the welding points Tn.

Next, explanation will be made with reference to FIGS. 7 to 16 for themethod for setting the narrow-area operation path in step S5 shown inFIG. 6.

When the narrow-area operation path is set, three methods areprincipally used in order to determine the path for withdrawing the gununit 68 from the welding portion of the workpiece 80.

Firstly, a method is used to directly make movement from the weldingportion to the withdrawing point. Secondly, a method is used to makemovement from the welding point to the center of gravity on the crosssection of the workpiece 80. Thirdly, a method is used to extract only aportion of the workpiece 80 disposed closely to the opening of the gununit 68 so that the withdrawing path is determined by preferentiallyusing the extracted portion.

In step S101 shown in FIG. 7, the gun unit 68 of the articulated robot50 is set at the position at which the welding point T0 of the workpiece80 is welded.

The welding point T0 gives the adjustment start position (Ts), and henceit is recorded on the temporary path table 12 for the operation data toperform the initialization (see Order 1 shown in FIG. 10).

As shown in FIG. 10, the path table 120 comprises the column 120 a of“Direction of gun unit”, the column 120 b of “Position of TCP”, and thecolumn 120 c of “Angle of each axis”. The column 120 c of “Angle of eachaxis” includes the angles of rotation θ1 to θ6.

Subsequently, in step S102 shown in FIG. 7, TCP of the gun unit 68located at the welding point To is set as the investigation startposition Ts.

Subsequently, in step S103, the central point C (see FIG. 11A) isdefined at the substantial center of the gun unit 68 where the arm 74and the electrodes 70, 72 are overviewed. Radial straight lines 1090 areset from the central point C at predetermined angle widths to determinepoints of intersection 1092 on the inner circumferential side of the arm74 and the electrodes 70, 72.

For the simplified explanation, the points of intersection 1092 aredetermined on the plane. However, actually, the points of intersectionare determined in the three-dimensional shape by utilizing the data inthe depth direction as well. Accordingly, the workpiece model (objectiveworkpiece portion) 1096 described later on and the solids (or blocks)1094 described below are dealt with as three-dimensional shapes not asplanar shapes.

Subsequently, in step S104, as shown in FIG. 11B, the plurality ofpoints of intersection 1092 are connected with a line segment to set anannular line 1092 b for forming a closed interval 1092 a. Lattice-shapedlines, which have predetermined spacing distances, are set in the closedinterval 1092 a to extract points of intersection 1092 c existing in theclosed interval 1092 a, of points of intersection of the lattice-shapedlines.

Subsequently, in step S105, as shown in FIG. 12A, square solids 1094 areembedded about the centers of the extracted points of intersection 1092c so that no gap is formed to set the internal space of the gun.

The processes of steps S103 to S105 are executed by the function of theinternal space-defining section 35 d.

Subsequently, in step S106, as shown in FIG. 12B, the workpiece 80 isarranged so that the workpiece 80 is matched for relative positions withrespect to the gun unit 68 and the gun internal space. A portion, inwhich the workpiece 80 and the solids 1094 are overlapped with eachother, is extracted as a workpiece model 1096 (see FIG. 12C). Then, aportion 80 a of the workpiece 80, which is not overlapped with thesolids 1094, is excluded, because the portion is irrelevant to theinvestigation of the interference. The respective solids 1094, whichconstitute the workpiece model 1096, are distinguished as workpiecesolids 1098. Even if the gun unit 68 is moved, the initial positions arefixed for the workpiece model 1096 and the respective workpiece solids1098.

The process in step S106 is executed by the function of theworkpiece-extracting section 35 e.

As described above, the process is easily performed, because theworkpiece 80 is dealt with as the model with the plurality of blocks.Further, no useless processing is performed, because any unnecessaryportion of the workpiece 80 (for example, non-overlapped portion 80 a)is automatically excluded.

Subsequently, in step S107, the principal component line (or thereference line) M1 of the workpiece model 1096 is calculated by thetechnique of principal component analysis.

The method for calculating the principal component line M1 will beexplained in detail. As shown in FIG. 13A, central point coordinates(Xs, Ys, Zs) of the respective workpiece solids 1098 are defined.

Subsequently, as shown in FIG. 13B, the square sum of the distance sbetween each of the central point coordinates 1098 a and the principalcomponent line M1 is made minimum. The principal component line M1 isdefined to satisfy the following expression.Σ|s|²=min

Specifically, the respective central point coordinates 1098 a are usedto calculate the eigen value and the eigen vector of the variance andcovariance matrixes, and Xs, Ys, Zs are used to determine the positionof the center of gravity G1 as an average value of the respectivecoordinates of X, Y, Z. The eigen vector, which passes through thecenter of gravity position G1, is the principal component line M1.

In the following steps S108 to S112, as shown in FIG. 14, it isinvestigated whether any interference is caused when the operation isperformed linearly from the investigation start point Ts to thewithdrawing position Ue.

Specifically, in step S108, the withdrawing position Ue is determined.As shown in FIG. 14, the withdrawing position Ue resides in the positionon the principal component line M1. The vector Xr, which is based on TCPof the gun unit 68, is moved while making coincidence with the principalcomponent line M1. The place, at which the gun unit 68 and theelectrodes 70, 72 do not interfere, is set as the withdrawing positionUe.

Subsequently, in step S109, the posture of the articulated robot 50,i.e., the angles of rotation θ1 to θ6 are determined based upon theposition and the posture of the gun unit 68 prescribed by thewithdrawing position Ue. In this calculation method, the determinationmay be made by the inverse operation from the six values in totalprescribed by the position coordinates (X, Y, Z) in the space of thewithdrawing position Ue and the vector Xr, the vector Yr, and the vectorZr for representing the posture of the gun unit 68.

Subsequently, in step S110 for the branching judgment, it is judgedwhether the solution is normally determined in the inverse operation instep S109. That is, it is judged whether TCP is capable of arriving atthe withdrawing position Ue. If the solution is not determined, if thevalue of the angle is without the rotatable range of the axis J1 to J6even if the solution is determined, or if the articulated robot 50interferes with other structures in the determined posture, then theroutine proceeds to step S111. If the solution is normally determined,the routine proceeds to step S112.

In the investigation for the interference, especially when the X-typewelding gun 68 a is adopted for the gun unit, the investigation is madefor both of the open state and the closed state of the gun unit.

If the solution is not determined normally, the rotation operation isperformed in step S111 to make rotation by α° about the center of thevector Yr. The rotation operation means the fact that the gun unit 68 isrotated about the center of the withdrawing position Ue within a rangeto cause no interference with the workpiece model 1096 as indicated bytwo-dot chain lines shown in FIG. 14. After the vector Xr, the vectorYr, and the vector Zr are determined in this state, the routine returnsto step S109. The investigation may be performed assuming that the angleα° has angle values in both of plus and minus directions.

If the loop, which is formed by steps S109 to S111, is continuouslyexecuted predetermined number of times, the withdrawing position Ue isset again at an appropriate position which is farther on the principalcomponent line M1 and at which the posture of the articulated robot 50holds. Next, the routine proceeds to the next step S112.

The process for making the rotation by α° is not limited to the processbased on the center of the vector Yr. The process may reside in rotationabout the axis, for example, the vector Xr or the vector Zr. Such aprocess may be adopted in the following process for rotation in the samemanner as described above.

Next, the routine proceeds to the process shown in FIG. 8. In step S112,as indicated by the path V1 shown in FIG. 14, the gun unit 68 isoperated linearly from the investigation start position Ts to thewithdrawing position Ue to investigate whether any interference occursbetween the arm 74 and the electrodes 70, 72 and the workpiece model1096.

In step S113 for the branching judgment, if it is judged that anyinterference occurs according to the investigation in step S112, theroutine proceeds to step S114. If it is judged that no interferenceoccurs, the routine proceeds to step S131 as the termination process,because the withdrawing operation can be performed by one time of theoperation.

As described above, if the shape of the workpiece 80 is simple, it ispossible to shorten the process time, because the withdrawing path canbe determined by one time of the operation.

In the example shown in FIG. 14, the electrode 70 clearly interfereswith the projection 1096 a of the workpiece model 1096 during themovement along the path V1. In this case, the routine proceeds to stepS114.

In the following steps S114 to S118, it is investigated whether anyinterference occurs when the operation is performed linearly from theinvestigation start position Ts to the center of gravity position G1 ofthe workpiece model 1096.

Specifically, in step S114, as shown in FIG. 15, the path V2, whichconnects the investigation start position Ts and the center of gravityposition G1, is defined. The posture of the gun unit 68 is assumed, inwhich the vector Xr coincides with the path V2 based upon the center ofgravity position G1.

In step S115, the posture of the articulated robot 50 is determined withthe assumed posture by the inverse operation described above.

Subsequently, in step S116 for the branching judgment, it isinvestigated whether the solution in the inverse operation is normallydetermined in the same manner as in step S110. Then, in addition to theinverse operation process, it is also preferable to investigate whetherthe gun unit 68 interferes with the workpiece model 1096.

If the solution is not determined normally, the rotation operation isperformed to rotate by α° about the center of the vector Yr (step S117)in the same manner as in step S111. After the vector Xr, the vector Yr,and the vector Zr are determined in this state, the routine returns tostep S115.

If the solution is determined, the interference is investigated bylinearly operating the gun unit 68 along the path V2 from theinvestigation start position Ts to the center of gravity position G1 instep S118 in the same manner as in step S112.

If the loop, which is formed by steps S115 to S117, is continuouslyexecuted predetermined number of times, it is judged that the gun unit68 cannot be arranged at the center of gravity position G1. After thisprocessing is finished, the routine proceeds to step S124 as the maskprocess.

If it is judged that any interference occurs by the investigationperformed in step S118 described above and step S130 described later on,the routine proceeds to step S124 via step S119 for the branchingjudgment. If it is judged that no interference occurs, the routineproceeds to the next step S120, assuming that the operation issuccessfully performed up to the center of gravity position.

In step S120, the posture of the articulated robot 50 at that point oftime is additionally recorded on the path table 120.

Subsequently, in step S121, the operation is made linearly from theposition of the gun unit 68 at that point of time to the withdrawingposition Ue in the same manner as in step S112 to investigate whetherinterference occurs. In the example shown in FIG. 15, the investigationis made along the principal component line M1.

In step S122 for the branching judgment, if it is judged that anyinterference occurs by the investigation in step S121, the routineproceeds to step S123. If it is judged that no interference occurs, theroutine proceeds to step S131 as the termination process, because thewithdrawing operation can be performed by this operation.

If there is any interference, the position of the gun unit 68 at thatpoint of time is used as a new investigation start position in step S123to perform the updating process to make exchange for the previousinvestigation start position Ts. That is, in the example shown in FIG.15, it is judged that the portion outside the gun internal space needsnot to be considered any more, because the gun unit 68 is successivelywithdrawn up to the center of gravity position G1. Therefore, theinvestigation start position Ts is also updated in order to set theworkpiece model 1096 again at that point of time.

The workpiece solids 1096 are extracted and updated in the same manneras in step S106 described above. A new principal component line M1 and anew center of gravity position G1 are determined in the same manner asin step S107 described above to update them respectively, and then theroutine returns to step S114. After the routine returns to step S114,the processing is continued for the new workpiece solids 1096, theprincipal component line M1, and the center of gravity position G1determined in step S123.

As described above, the portion, which is not included in the guninternal space, is successively excluded from the processing objective.Therefore, it is possible to determine the path for withdrawing the gununit 68 for the workpiece 80 having any complicated shape as well.

However, if the loop, which is formed by steps S114 to S123, is executednot less than predetermined number of times, it is judged that it isextremely difficult to withdraw the gun unit 68 for the workpiece 80.Therefore, the processing is finished to make the plan again.

Next, explanation will be made for steps S124 to S130 as the processingto be performed if it is judged in step S119 that any interferenceoccurs due the operation along the path Vn (n=1, 2, 3, . . . ). In thiscase, only a portion of the workpiece model 1096, which is located nearthe opening of the gun unit 68, is extracted (or subjected to the maskprocess) to preferentially use the extracted portion so that thewithdrawing path is determined.

In step S124 shown in FIG. 9, as shown in FIG. 16, a portion of theworkpiece model 1096, which is located on the side of the opening of thegun unit 68, is designated as a new objective workpiece portion 1096 cbased upon the center of gravity position G1, and the portion isdistinguished from a portion 1096 c which is located on the sideopposite to the opening. In the distinguishing process, the process isconceived so that the gun unit 68 is withdrawn for only the portiondisposed closely to the opening. The processing is reserved for theportion 1096 c located on the side opposite to the opening to extractthe new objective workpiece portion 1096 b of the opening. The workpiecemodel 1096 is replaced with the new objective workpiece portion 1096 bto be dealt with up to steps S125 to S130 as the downstream processes.

Subsequently, in step S125, the principal component line M2 and thecenter of gravity position G2 are determined in relation to the newobjective workpiece portion 1096 b in the same manner as in the processin step S107 described above.

In step S126, the path V3 for connecting the investigation startposition Ts and the center of gravity position G2 is defined in the samemanner as in step S114 described above to assume the posture of the gununit 68 in which the vector Xr is allowed to coincide with the path V3based upon the center of gravity position G2.

Subsequently, in step S127, the posture of the articulated robot 50 isdetermined with the assumed posture by the inverse operation in the samemanner as in step S115 described above.

Subsequently, in step S128 for the branching judgment, it isinvestigated whether the solution in the inverse operation is determinednormally in the same manner as in step S116 described above.

If the solution is not determined normally, the rotation operation isperformed to make rotation by α° about the center of the vector Yr (stepS129) in the same manner as in step S117 described above. The routinereturns to step S127.

If the solution is determined, in step S130, the gun unit 68 is linearlyoperated along the path V3 from the investigation start position Ts tothe center of gravity position G2 to investigate the interference in thesame manner as in step S118 described above. The routine returns to stepS119 to judge the interference investigation.

As described above, even if no appropriate path is found when the pathis retrieved for the object of the entire workpiece model 1096, thenonly the new objective workpiece portion 1096 b, which is locatedclosely to the opening of the gun unit 68, can be preferentially used todetermine the withdrawing path by applying the mask process to theworkpiece model 1096. Further, in the downstream processing, theworkpiece model 1096 is successively converted into one having thesimple shape by combining the updating process for the workpiece model1096 in step S123 described above, making it easy to determine thewithdrawing path.

If the loop, which is formed by steps S127 to S129, is continuouslyexecuted predetermined number of times, it is judged that the gun unit68 cannot be arranged at the center of gravity position G2. The routinereturns to step S124 in order to perform the further mask process.However, if the mask process is executed not less than predeterminednumber of times, it is judged that the mask process is not effective forthe shape of the workpiece 80. The routine returns to step S120 which isthe withdrawing process applied with no mask process to calculate thewithdrawing path again.

In step S131 as the termination process, for example, the coordinate ofthe withdrawing position Ue as the investigation end position and thevector data are added as the operation data to the path table 120 (seeFIG. 10). Among them, Un as the operation data is inserted between therespective welding points Tn in the path table 120. Next, the routinereturns to the process shown in FIG. 6.

As described above, even if no appropriate path is found when the pathis retrieved for the object of the entire workpiece model 1096, thenonly the portion, which is located closely to the opening of the gununit 68, can be preferentially used to determine the withdrawing path byapplying the mask process to the workpiece model 1096. Further, in thedownstream processing, the workpiece model 1096 is successivelyconverted into one having the simple shape by combining the updatingprocess for the workpiece model 1096 in step S123 described above,making it easy to determine the withdrawing path.

In the above explanation, the technique for determining the path towithdraw the gun unit 68 from the welding point of the workpiece 80 hasbeen described. As for the path for advancing the gun unit 68 into thewelding point, the advancing path may be obtained by inverting the orderin the path table 120.

The principal component line has been used as the reference line for theworkpiece model 1096. Another reference line such as a straight linebased on the least square method or a curve having an arbitrary ordermay be used if the shape of the workpiece model 1096 is represented bythe line or the curve.

Next, explanation will be made with reference to FIGS. 17 to 21 for themethod for setting the wide-area operation path in step S6 shown in FIG.6.

In the following description, as shown in FIG. 17, explanation will bemade for an example in which the gun unit 68 is operated from the startpoint P1 at which the workpiece 80 as the thin plate is disposed to thearrival point P2. It is assumed that the obstacle 82 exists between thestart point P1 and the arrival point P2. The withdrawing positions Ue,which are determined in the setting of the narrow-area operation pathdescribed above, are dealt with as the start point P1 and the arrivalpoint P2.

In step S201 shown in FIG. 18, the wide-area operation path-settingsection 35 b of the operation path-setting program 35 is executed by apredetermined operation method by an operator for the off-line teachingapparatus 10. This process may be continuously performed after thesetting of the narrow-area operation path.

In step S202, the wide-area operation path-setting section 35 b reads,from the hard disk 34, the condition data 37 as the condition forsetting the operation path, and the data is stored in RAM 29. Further,the start point P1 and the arrival point P2 for setting the operationpath as well as the shape of the workpiece 80 and the position of theobstacle 82 or the like are recognized from the condition data 37.

Subsequently, in step S203, the operation path (path) 100 to connect thestart point P1 and the arrival point P2 is set to investigate theacceptance or rejection of establishment of the posture and theoccurrence of any interference when the gun unit 68 is operated alongthe operation path 100.

Specifically, dividing points, which are obtained by dividing theoperation path 100 into those having minute lengths, are set by thefunction of the path-investigating section 35 c. The postures of thearticulated robot 50, i.e., the angles of rotation θ1 to θ6, which areobtained when the gun unit 68 is arranged at the respective dividingpoints, are determined by means of the inverse operation.

When the posture of the gun unit 68 differs between the start point P1and the arrival point P2, the vector Xr, the vector Yr, and the vectorZr for indicating the posture of the gun unit 68 may be defined at therespective dividing points in a manner of linear interpolation. In thisinvestigation, it is assumed that the electrodes 70, 72 are opened sothat they may not interfere with the workpiece 80.

If the posture of the articulated robot 50 holds at each of the dividingpoints, the operation from the start point P1 to the arrival point P2 isactually assured.

Steps S206, S212, S215, S218, S224, and S227 described later on are alsoexecuted by the function of the path-investigating section 35 c.

In step S204, it is judged whether the solution of the inverse operationis normally determined at each of the dividing points. Specifically, itis judged whether TCP is capable of arriving at the dividing point. Ifthe solution is not determined, if the value of the angle is without therotatable range of the axis J1 to J6 even if the solution is determined,or if the articulated robot 50 interferes with the obstacle 82 or thelike in the determined posture, then the routine proceeds to step S205.If the solution is normally determined, the termination process isperformed for the setting of the wide-area operation path in step S229.

The function of the interference of the simulation circuit 40 may beused for the occurrence of interference.

In step S205 shown in FIG. 19, in order to avoid the obstacle 82 orestablish the posture, the template operation is applied from the startpoint P1 for the gun unit 68 to set a first junction point Q1. In thiscase, the template represents the prescribed operation to be executed bythe articulated robot 50.

It is assumed that the first template is applied to the start point P1and the arrival point P2.

As shown in FIG. 21, the first template resides in the operation inwhich the first junction point Q1 obtained by operating in theprescribed direction by the prescribed distance is set based upon TCP ofthe gun unit 68, and the gun unit 68 is moved along the operation path(retracting path) 102 (see FIG. 17) for connecting the start point P1and the first junction point Q1. The first junction point Q1 is obtainedby moving the position of the start point P1. It is assumed that thedirection of the gun unit 68 possessed by the start point P1, i.e., thedirection of TCP is unchanged.

In general, in order to properly perform the welding operation, thevector Zr is set to be perpendicular to the workpiece 80. Therefore, itis preferable that the prescribed direction is the withdrawing directionfor the gun unit 68, i.e., the direction opposite to the vector Xr. Adistance, with which the gun unit 68 can be sufficiently disengaged fromthe workpiece 80, may be previously prescribed for the prescribeddistance depending on the size of the gun unit 68. In the gun unit of ageneral size, it is preferable that the prescribed distance is 100 mm.

The first template provides an effective retracting method for the thinplate which is a general workpiece. It is possible to set the operationpath in accordance with the predetermined convenient retracting methodwithout being affected by the shape of the workpiece.

Subsequently, in step S206, the acceptance or rejection of the postureestablishment of the articulated robot 50 at the first junction point Q1and the occurrence of interference with the peripheral obstacle areinvestigated in the same manner as in step S203.

Subsequently, in step S207, if it is judged that the posture of thearticulated robot 50 holds at the first junction point Q1 and there isno interference as a result of the investigation in step S206, theroutine proceeds to step S212. Otherwise, the routine proceeds to stepS208.

In step S208, in order to obtain the appropriate posture at the firstjunction point Q1, the posture is set, in which the gun unit 68 isrotated by a predetermined angle about the center of the vector Xr, Yror Zr. The rotating process is performed together with step S209 as thenext judgment process to make successive rotation for all of the vectorsYr, Zr, and Xr.

Subsequently, in step S209, it is confirmed whether the added up angleof the rotation by the predetermined angle one by one arrives at 360°.If the added up angle is less than 360°, the routine proceeds to stepS206 to judge the posture of the articulated robot 50.

If no proper posture is obtained at the first junction point Q1 even ifthe rotation is performed by 360° for each of the vector Xr, the vectorYr, and the vector Zr, then the first junction point Q1 is set again instep S210 at a position returned by a predetermined distance in thedirection toward the start point P1. That is, if the first junctionpoint Q1 is set at the distance of 100 mm from the start point P1, thepoint is returned by 10 mm in the direction toward the start point P1 toset the point again at the position of 90 mm.

Subsequently, in step S211, the added up value of the distance of thereturn of the first junction point Q1 is confirmed. If the point isreturned to the start point P1 as the original point, then the processis stopped, and the plan is made again. If the point is not returned tothe start point P1, i.e., if the range of 10 to 90 mm is given, then theroutine proceeds to step S206 to judge the posture of the articulatedrobot 50.

In step S212 (if it is judged that the posture of the articulated robot50 holds and no interference is caused in the judgment in step S207described above), the investigation is performed by the same process asin step S203 for the acceptance or rejection of the postureestablishment and the occurrence of the interference when the gun unit68 is operated along the operation path 102.

Subsequently, in step S213, the judgment is made in the same manner asin step S204. If it is judged that the posture of the articulated robot50 holds at the dividing point on the operation path 102 and theoperation can be performed along the operation path 102, then theroutine proceed to the next step S214. If it is judged that theoperation cannot be performed, the routine is returned to step S210 tofurther change the position of the first junction point Q1.

In step S214, it is confirmed that two of the first junction point Q1and the first junction point Q2 are set for the start point P1 and thearrival point P2. The routine proceeds to the next step S215. If thefirst junction point Q2 corresponding to the arrival point P2 is notset, the routine is returned to step S205 shown in FIG. 19.

Subsequently, in step S215, the operation path 104 for connecting thetwo first junction points Q1 and Q2 is set to investigate the acceptanceor rejection of the posture establishment and the occurrence of theinterference when the gun unit 68 is operated along the operation path104.

Specifically, the processing is performed while prescribing that thefirst junction point Q1 is the new start point and the first junctionpoint Q2 is the new arrival point. The investigation is made for theoperation path 104 in the same manner as in the investigation for thepath between the start point P1 and the arrival point P2 in step S203described above.

Subsequently, in step S216, the judgment is made in the same manner asin step S204. If it is judged that the posture of the articulated robot50 holds at the dividing point on the operation path 104 and theoperation can be performed along the operation path 104, then thetermination process is performed for the setting of the wide-areaoperation path in step S229 shown in FIG. 18. If it is judged that theoperation cannot be performed, the routine proceeds to the next stepS217.

In step S217 shown in FIG. 20, in order to avoid the obstacle 82, thetemplate operation is applied from the first junction point Q1 for thegun unit 68 to set a second junction point R1.

It is assumed that the second template is applied to the first junctionpoint Q1 (and Q2).

As shown in FIG. 21, the second template is used such that the line 108for connecting the first junction point Q1 and the predeterminedestablished point 106 is set, and the second junction point R1 isdefined as the point obtained by moving by a prescribed distance fromthe first junction point Q1 on the line 108.

The second junction point R1 is obtained by moving only the spatialposition for the first junction point Q1. It is assumed that thedirection of the gun unit 68 possessed by the first junction point Q1,i.e., the direction of TCP is unchanged.

The second template is provided for the gun unit 68 having beendisengaged from the workpiece 80 in order to operate in the direction inwhich the interfering obstacle 82 does not exist. The movement is madein the direction toward the origin O with the free space in which thepossibility of existence of the obstacle 82 is low. That is, in general,the obstacle 82 tends to be absent near the origin O such that theoperation of the articulated robot 50 is not inhibited. When theoperation is made in this direction, the possibility of avoiding theobstacle 82 is preferably increased. Further, as for the articulatedrobot of a general size, the prescribed distance is preferably 100 mm.

Those other than the origin O may be used as the established point 106.If there is any place at which the obstacle 82 does not exist or ifthere is any place at which the operation is easily performed, such aplace may be used for the established point 106. For example, when theoperation range of the articulated robot 50 is expressed in the space,it is conceived that the degree of freedom of the operation is largestat the central position. Therefore, such a position may be used for theestablished point 106.

Subsequently, in step S218, the acceptance or rejection of the postureestablishment of the articulated robot 50 at the second junction pointR1 and the occurrence of any interference with the peripheral obstacleare investigated in the same manner as in step S203.

Subsequently, in step S219, if it is judged that the posture of thearticulated robot 50 holds at the second junction point R1 and there isno interference as a result of the investigation in step S218, theroutine proceeds to step S224. Other than the above, the routineproceeds to step S220.

In step S220, in order to obtain the appropriate posture at the secondjunction point R1, the posture is set, in which the gun unit 68 isrotated by a predetermined angle about the center of the vector Xr, Yr,or Zr in the same manner as in step S208.

Subsequently, in step S221, it is confirmed whether the added up angleof the rotation by the predetermined angle one by one arrives at 360°.If the added up angle is less than 360°, the routine proceeds to stepS218 to judge the posture of the articulated robot 50.

If no proper posture is obtained at the second junction point R1 even ifthe rotation is performed by 360° for each of the vector Xr, the vectorYr, and the vector Zr, then the second junction point R1 is set again instep S222 at a position obtained by movement by a predetermined distancein the direction toward the established point 106. That is, if thesecond junction point R1 is set at the distance of 100 mm from the firstjunction point Q1, the point is further moved by 100 mm in the directiontoward the established point 106 to set the point again at the positionof 200 mm.

Subsequently, in step S223, the added up value of the distance of themovement of the second junction point R1 is confirmed. If the pointarrives at the established point 106, then the process is stopped, andthe plan is made again. If the point does not arrive at the establishedpoint 106, the routine proceeds to step S218 to judge the posture of thearticulated robot 50.

In step S224 (if it is judged that the posture of the articulated robot50 holds and no interference is caused in the judgment in step S219described above), the operation path (retracting path) 110 forconnecting the first junction point Q1 and the second junction point R1is set. The investigation is performed by the same process as in stepS203 for the acceptance or rejection of the posture establishment andthe occurrence of the interference when the gun unit 68 is operatedalong the operation path 110.

Subsequently, in step S225, the judgment is made in the same manner asin step S204. If it is judged that the posture of the articulated robot50 holds at the dividing point on the operation path 110 and theoperation can be performed along the operation path 110, then theroutine proceed to the next step S226. If it is judged that theoperation cannot be performed, the routine is returned to step S222 tofurther change the position of the first junction point Q1.

In step S226, it is confirmed that two of the second junction points R1and R2 are set for the first junction points Q1 and Q2. The routineproceeds to the next step S227. If the second junction point R2corresponding to the first junction point Q2 is not set, the routine isreturned to step S217.

Subsequently, in step S227, the operation path 112 for connecting thetwo second junction points R1 and R2 is set to perform the investigationfor the operation on the operation path 112 in the same manner as instep S203.

Subsequently, in step S228, the judgment is made in the same manner asin step S204. If it is judged that the posture of the articulated robot50 holds at the dividing point on the operation path 112 and theoperation can be performed along the operation path 112, then thetermination process is performed for the setting of the wide-areaoperation path. If it is judged that the operation cannot be performeddue to the interference with the obstacle or the like, then the routineis returned to step S222, and the two second junction points R1, R2 arefurther moved to repeat the process until the operation path holds.

After completing the setting of the operation path from the start pointP1 to the arrival point P2, the termination process is performed for thesetting of the wide-area operation path in step S229 shown in FIG. 18.The termination process includes, for example, the recording of the setwide-area operation path on the path table 120 (see FIG. 10). The startpoint P1, the first junction point Q1, the second Junction point R1, thesecond junction point R2, the first junction point Q2, and the arrivalpoint P2, which are included in the set operation path, are recorded inan order of operation on the path table 120. Specifically, the values ofthe angles of rotation θ1 to θ6 about the respective axes of thearticulated robot 50 and the values of the vectors Xr, the vector Yr,and the vector Zr indicating TCP and the position coordinates (X, Y, Z)at the respective points are recorded.

The operation path recorded on the path table 120 is converted by thedata-preparing circuit 38 into the program data for operating the actualarticulated robot 50, and the data is transmitted to the robot controlunit 22.

The path table 120 is recorded in RAM 29 and the hard disk 34. However,if necessary, the path table 120 may be printed or displayed on thescreen of the monitor 16.

In the foregoing description, the operation path 104 is the path forconnecting the first junction points Q1 and Q1. Alternatively, the firsttemplate may be applied to only the side of the start point P1 todetermine the first junction point Q1, and the application may be madeas it is for the arrival point P2 to set the path for connecting thefirst junction point Q1 and the arrival point P2.

As for the operation path 112, for example, the path for connecting thesecond junction point R1 and the first junction point Q2 may be set inthe same manner as described above.

The operation paths 102, 110 as the retracting path for making theretraction from the start point P1 may be also used when the operationis made to another point other than the arrival point P2.

The prescribed distance, which is firstly applied for the firsttemplate, is 100 mm. Alternatively, starting from 10 mm, the distancemay be elongated to 20 mm and 30 mm.

The order of application of the first and second templates may beinverted depending on the situation concerning, for example, theworkpiece 80 and the obstacle 82.

The set path table 120 indicates the wide-area operation path from thestart point P1 to the arrival point P2 or the narrow-area operation pathfor representing the withdrawing operation from the welding point Tn.However, the operation paths are reversible, and they may be used uponthe operation from the arrival point P2 to the start point P1. Further,the path may be utilized up to an intermediate position without usingthe entire operation path.

Further, the embodiment of the present invention is applicable, forexample, to an assembling robot and an applying robot other than thewelding robot. The articulated robot 50 may have a seven-axis structureor a structure having, for example, a link mechanism or anexpansion/contraction mechanism.

As described above, according to the embodiment of the presentinvention, the operation path 100 for connecting the start point P1 andthe arrival point P1 is firstly set to investigate whether the gun unit68 can be operated along the operation path 100. Therefore, if the gununit 68 can be operated along the operation path 100, the operation pathcan be set extremely conveniently without providing any junction pointor the like for the operation. Even if the operation on the operationpath 100 cannot be performed, the first template is applied to operateby the prescribed distance in the direction opposite to the vector Xr asthe prescribed direction from the start point P1 or the arrival pointP2. Therefore, the first junction points Q1 and Q2 can be setautomatically and efficiently without performing any complicatedcalculation and without being affected by the shape of the workpiece 80.

The first template is used to operate by the prescribed distance withwhich the gun unit 68 can be sufficiently retracted from the workpiece80 depending on the size of the gun unit 68 in the prescribed directionset in the direction in which it is conceived to retract the gun unit 68most easily with respect to the workpiece 80. Therefore, although themethod is convenient, the possibility of the successful and saferetraction from the workpiece 80 is high. Further, for example, in step206, the safety is verified. Therefore, there is no fear of interferenceor the like when the articulated robot 50 is actually operated.

According to the embodiment of the present invention, if the firstjunction points Q1, Q2 or the second junction points R1, R2, which areset on the retracting path, are the points at which the articulatedrobot 50 cannot arrive or at which any interference occurs, theprescribed distances of the first and second templates are corrected toset the positions of the first junction points Q1, Q2 or the secondjunction points R1, R2 again. Therefore, it is possible to set thepreferable retracting position.

As for the second template, the prescribed direction is the directiontoward the origin O for the coordinate calculation for the articulatedrobot 50. Therefore, the possibility of interfering with the obstacle 82is low.

Further, according to the embodiment of the present invention, the firsttemplate and the second template are applied in combination. The gununit 68 is firstly retracted from the workpiece 80 with the firsttemplate, and then the gun unit 68 is retracted from another obstacle 82or the like with the second template to thereby verify the safety.Therefore, it is possible to set the retracting path and the wide-areaoperation path automatically and efficiently without performing anycomplicated calculation. Thus, it is of course possible to improve theoperation efficiency. Further, it is also possible to improve thequality of the off-line teaching data without relying on the skill ofthe operator.

It is a matter of course that the setting method and the settingapparatus for the operation path for the articulated robot according tothe present invention are not limited to the illustrative embodimentsdescribed above, which may be embodied in other various forms withoutdeviating from the gist or essential characteristics of the presentinvention.

1. A method for setting an operation path for an articulated robot including an end effector, said method comprising: an internal space-defining step of defining an internal space which is partially surrounded by an arm or electrodes of said end effector; an extracting step of extracting a portion of a workpiece to be welded existing in said internal space as an objective workpiece portion of said workpiece; and an interference-investigating step of investigating whether interference occurs between said end effector and said objective workpiece portion when said articulated robot is operated.
 2. The method for setting said operation path for said articulated robot according to claim 1, wherein said workpiece is a model which is approximated with a plurality of blocks.
 3. The method for setting said operation path for said articulated robot according to claim 1, wherein said internal space is a model which is approximated with a plurality of blocks.
 4. The method for setting said operation path for said articulated robot according to claim 1, wherein said interference-investigating step comprises: a reference line-defining step of defining a reference line passing through a center of said objective workpiece portion; an investigation end position-defining step of setting an investigation end position for said end effector on said reference line; and a first detailed interference-investigating step of investigating whether interference occurs between said end effector and said objective workpiece portion by operating said end effector from an investigation start position to said investigation end position.
 5. The method for setting said operation path for said articulated robot according to claim 1, wherein said interference-investigating step comprises: a reference line-defining step of defining a reference line passing through a center of said objective workpiece portion; a center of gravity position-defining step of defining a center of gravity position of said objective workpiece portion based on said reference line; and a second detailed interference-investigating step of investigating whether interference occurs between said end effector and said objective workpiece portion by operating said end effector from an investigation start position to said center of gravity position.
 6. The method for setting said operation path for said articulated robot according to claim 5, wherein a portion of said objective workpiece portion, which is located near an opening as compared with said center of gravity position of said objective workpiece portion, is extracted as a new objective workpiece portion to perform said center of gravity position-defining step and said second detailed interference-investigating step, said objective workpiece portion being replaced with said new objective workpiece portion.
 7. An apparatus for setting an operation path for an articulated robot including an end effector, said apparatus comprising: an internal space-defining section for defining an internal space which is partially surrounded by an arm or electrodes of said end effector; a workpiece-extracting section for extracting a portion of a workpiece to be welded existing in said internal space as an objective workpiece portion of said workpiece; and an interference-investigating section for investigating whether interference occurs between said end effector and said objective workpiece portion when said end effector is operated.
 8. A method for setting an operation path for an articulated robot for operating an end effector from a start point to an arrival point, said method comprising: an operation-investigating step of setting a path for connecting said start point and said arrival point to investigate whether said end effector can be operated along said path; and a retracting path-setting step of setting a retracting path for operating said end effector by a prescribed distance in a prescribed direction from said start point or said arrival point if said end effector cannot be operated along said path in said operation-investigating step.
 9. The method for setting said operation path for said articulated robot according to claim 8, wherein said prescribed direction is predetermined based on a posture of said end effector at said start point or said arrival point.
 10. The method for setting said operation path for said articulated robot according to claim 8, wherein said prescribed direction is a direction to connect said start point or said arrival point and an established point in space.
 11. The method for setting said operation path for said articulated robot according to claim 10, wherein said established point is a central point of an original axis of said articulated robot.
 12. The method for setting said operation path for said articulated robot according to claim 8, wherein an end point of said retracting path is defined as a new start point or a new arrival point to execute said operation-investigating step or said retracting path-setting step again.
 13. The method for setting said operation path for said articulated robot according to claim 8, wherein said retracting path is set, again if an end point of said retracting path is a point at which said articulated robot cannot arrive or at which interference occurs, said prescribed distance being corrected in said retracting path.
 14. An apparatus for setting an operation path for an articulated robot for operating an end effector from a start point to an arrival point, said apparatus comprising: a path-investigating section for setting a path for connecting said start point and said arrival point to investigate whether said end effector can be operated along said path; and a wide-area operation path-setting section for setting a retracting path for operating said end effector by a prescribed distance in a prescribed direction from said start point or said arrival point if said path-investigating section judges that said end effector cannot be operated along said path.
 15. A method for setting an operation path for an articulated robot for operating an end effector between operation points for a workpiece, said method comprising: a narrow-area operation path-setting step of setting a narrow-area operation path for retracting said end effector from said operation point to a point located near an end of said workpiece without interfering in said workpiece and another obstacle based on shapes of said obstacle and said workpiece near said operation point, said end effector being arranged at said operation point for said workpiece; said narrow-area operation path-setting step comprising: an internal space-defining step of defining an internal space which is partially surrounded by an arm or electrodes of said end effector; and an extracting step of extracting a portion of said workpiece to be welded existing in an internal space as an objective workpiece portion of said workpiece; an interference-investigating step of investigating whether interference occurs between said end effector and said objective workpiece portion when said articulated robot is operated, and a wide-area operation path-setting step of setting a wide-area operation path for effecting operation from a start point to an arrival point by combining predetermined prescribed operations provided that said start point and said arrival point reside in predetermined points located near said end of said workpiece.
 16. The method for setting said operation path for said articulated robot according to claim 15, wherein said wide-area operation path-setting step comprises: an operation-investigating step of setting a path for connecting said start point and said arrival point to investigate whether said end effector can be operated along said path; and a retracting path-setting step of setting a retracting path for operating said end effector by a prescribed distance in a prescribed direction from said start point or said arrival point if said end effector cannot be operated along said path in said operation-investigating step.
 17. The method for setting said operation path for said articulated robot according to claim 16, wherein said prescribed direction is predetermined based on a posture of said end effector at said start point or said arrival point.
 18. The method for setting said operation path for said articulated robot according to claim 16, wherein said prescribed direction is a direction to connect said start point or said arrival point and an established point in space.
 19. An apparatus for setting an operation path for an articulated robot for operating an end effector between operation points for a workpiece, said apparatus comprising: a narrow-area operation path-setting section for setting a narrow-area operation path for retracting said end effector from said operation point to a point located near an end of said workpiece without interfering in said workpiece and another obstacle based upon shapes of said obstacle and said workpiece near said operation point, said end effector being arranged at said operation point for said workpiece; said narrow-area operation path-setting comprising: an internal space-defining for defining an internal space which is partially surrounded by an arm or electrodes of said end effector; a workpiece-extracting section for extracting a portion of said workpiece to be welded existing in said internal space as an objective workpiece portion of said workpiece; and an interference-investigating section for investigating whether interference occurs between said end effector and said objective workpiece portion when said articulated robot is operated, and a wide-area operation path-setting section for setting a wide-area operation path for effecting operation from a start point to an arrival point by combining predetermined prescribed operations provided that said start point and said arrival point reside in predetermined points located near said end of said workpiece. 